




  <div class="successfull" style="display:<?php echo ($this->session->flashdata('userMesg') ? 'block' : 'none') ?> ">
                <?php echo $this->session->flashdata('userMesg'); ?>  
            </div>
            	
	 <div class="headingBox"  style="padding-top:10px;">
                <div class="FloatLeft"><img src="<?php echo imageUrl(); ?>red_leftRound.jpg" width="5" height="24" alt="" /></div>
              <div class="red_midRound" style="width:992px;"><span class="red_midRound" style="width:992px;"><?php echo $page_heading; ?></span></div>
                <div class="FloatLeft"><img src="<?php echo imageUrl(); ?>red_rightRound.jpg" width="5" height="24" alt="" /></div>
            </div>
            
            <div id="error_msg_div">
			<?php  if( count($error_arr) > 0 ) {
                        foreach( $error_arr as $err) {
                            echo '<div class="errorMsg_1" style="" align="center">'.$err.'</div>';	
                        }
                    }
                    //vardump($error_arr); 
                ?>
            </div>

            <div>
             <?php 
				$name = (isset($name) && $name != '' ) ? trim($name) : '';
			?>
             <form method="post" action="<?php echo base_url().$this->uri->segment(1); ?>/priority<?php echo "/$name" ; ?>">
               <input name="sbmt" id="sbmt" value="1" type="hidden">
             
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td><table width="100%" cellspacing="5" cellpadding="2" class="subContentTable">
                        <tr>
                        <td height="20" class="head3" width="30px;">Agent Name</td>
                        <td height="20" class="head3">Extension</td>
                        <td height="20" class="head3">Priority</td>
                        <td height="20" class="head3">Priority</td>
                       </tr>
                        <?php 
						$cnt = 0;
						foreach($results as $row) 
						{
							$bg_color = ($cnt%2 == 0) ? "#ffffff" : "#fff1d5";
							$cnt++;
							$id = $row->uniqueid;
							$penalty = (int)$row->penalty;
						?>
                        <tr bgcolor="<?php echo $bg_color; ?>">
                         <td align="left" height="20" width="15%"><?php echo $row->agent_name; ?></td>
                        <td height="20" align="center" width="10%"><?php echo parseAgentExt($row->agent); ?></td>
                        <td height="20" align="center" width="60%">
                        	<div id="slider_<?php echo $id; ?>"></div>
                            	
                        </td>
                        <td height="20" align="center" valign="middle" width="10%" >
                        	<input type="text" name="penalty[<?php echo $id; ?>]" id="txt_<?php echo $id; ?>" value="<?php echo $penalty; ?>" />
                        </td>
                        <script>
							$(function() {
								 slider_obj_<?php echo $id; ?> = $( "#slider_<?php echo $id; ?>" ).slider({ min: 0,
														max: 100,
														range: "min",
														slide: function(event, ui) 
														{
															$("#txt_<?php echo $id; ?>").val(ui.value);
														},
														value : <?php echo $penalty; ?>  });
							});
							
							$('#txt_<?php echo $id; ?>').blur(function() 
							{
								txtVal = $('#txt_<?php echo $id; ?>').val();
								//if not a number
								if(isNaN(txtVal))
								{
									$('#txt_<?php echo $id; ?>').val(0);
								}
								else if(parseInt(txtVal, 10) > 100)
								{
									$('#txt_<?php echo $id; ?>').val(100);
								}
								else if(parseInt(txtVal, 10) < 0)
								{
									$('#txt_<?php echo $id; ?>').val(0);
								}
																								
																								
								slider_obj_<?php echo $id; ?>.slider( "value", $('#txt_<?php echo $id; ?>').val()); 
 							} );
							
							
							</script>
                      </tr>
                        <?php 
							}
						?>
                        
                        <?php 
							if( count($results) == 0 ) {
								echo "<tr><td align='center' colspan='4'> No record(s) found. </td></tr>";	
							}
						?>
                       
                      <tr>
            	          	<td colspan="4" align="left">
        	            	    <input value="" class="backBtn" onclick="location.href='<?php echo base_url().$this->uri->segment(1); ?>';" type="button">
    	            	        <?php  if( count($results) > 0 ) { ?>
                                <input value="" class="submitBtn" type="submit">
                                <?php } ?> 
	            	        </td>
                      </tr>
                        
                        
                      </table></td>
                  </tr>
                  <tr>
                  	<td colspan="5" align="center"> <ul class="paging"> <?php echo  $this->pagination->create_links();  ?> </ul> </td>
                  </tr>
              </table>
              </form>
				</div>
  </div>           